Tag - Swift documentation markup

Swift documentation markup is not clear how to link to other type definition/method/... from the documentation. It can be done using Tag element.

/// An error
/// - Tag: SomeError
enum SomeError: Error {
}

/// Description
/// - Throws: An error of type [SomeError](x-source-tag://SomeError) might be thrown
func doSomething() throws {
    throw NSError(domain: "", code: 1, userInfo: nil)
}

If you do the quick help (⌥ + click) on the method doSomething the documentation will be presented with the clickable link SomeError that will navigate to the place where the tag is defined.

Screenshot 2021-02-04 at 08 39 47
Tagged with: